import request from '@/utils/request'

export default{

  //获取章节和小节
  getChapterAndVideo(courseId) {
    return request({
      url: `eduservice/chapter/getChapterAndVideo/${courseId}`,
      method: 'get'
    })
  },

  //单一添加章节
  addChapter(chapter) {
    return request({
      url: `eduservice/chapter/addChapterInfo`,
      method: 'post',
      data:chapter
    })
  },

  //根据章节Id查询章节
  getChapterById(chapterId) {
    return request({
      url: `eduservice/chapter/getChapterInfo/${chapterId}`,
      method: 'get'
    })
  },

  //修改章节对象
  updateChapterInfo(chapter) {
    return request({
      url: `eduservice/chapter/updateChapterInfo`,
      method: 'post',
      data:chapter
    })
  },

  //根据章节id删除对应章节 小节
  deleteChapterInfoAndVide(chapterId) {
    return request({
      url: `eduservice/chapter/deleteChapterInfoAndVide/${chapterId}`,
      method: 'post',
    })
  },


}
